From 7b259a67d75b579d95505edbfec11951ff3d52a6 Mon Sep 17 00:00:00 2001 From: Alynx Zhou Date: Fri, 9 May 2025 12:16:52 +0800 Subject: [PATCH] status/network: Fix VPN toggle not working when clicking the switch VPN activation is triggered by clicking/touching the item, however, the switch is reactive and blocks clicking/touching event so item won't be activated. Manually activate item when switch is toggled to fix that. Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8204 Part-of: --- js/ui/status/network.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/js/ui/status/network.js b/js/ui/status/network.js index ee9b22937..69337ca99 100644 --- a/js/ui/status/network.js +++ b/js/ui/status/network.js @@ -1323,6 +1323,16 @@ const NMVpnConnectionItem = GObject.registerClass({ this.bind_property('is-active', this._switch, 'state', GObject.BindingFlags.SYNC_CREATE); + + // Switch handle is reactive, so events don't propagate to the item; + // activate it manually in that case + this._switch.connect('notify::state', () => { + if (this.is_active === this._switch.state) + return; + + this.activate(); + }); + this.bind_property('name', this._label, 'text', GObject.BindingFlags.SYNC_CREATE); -- 2.39.5